import request from '@/utils/request'

// 获取列表
export function listOrder(query) {
  return request({
    url: '/system/admin/pays',
    method: 'get',
    params: query
  })
}

// 修改
export function updateOrder(data) {
  return request({
    url: `/system/admin/pays/${data.uuid}`,
    method: 'put',
    data: data
  })
}

// 删除
export function delOrder(uuid) {
  return request({
    url: `/system/admin/pays/${uuid}`,
    method: 'delete'
  })
}

// 详情
export function getOrder(uuid) {
    return request({
      url: `/system/pays/${uuid}`,
      method: 'get'
    })
}

// 退款
export function refundPay(data) {
  return request({
    url: '/pay/wx/refunds',
    method: 'post',
    data: data
  })
}

// 重新制作
export function reMakePay(data) {
  return request({
    url: '/pay/wx/photoPaySuccess',
    method: 'post',
    data: data
  })
}

// 导出列表
export function listOrderExport(query) {
  return request({
    url: '/system/admin/pays/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}